﻿using System;
using UnityEngine;

namespace AccountModule
{
    public class Account
    {
        public string name;
        public float money;
        public float height;
        public float weight;
        public Gender gender;
        public float experience;
        public Aims aims;

        public Account(string name, float money, float height, float weight, Gender gender, float experience)
        {
            this.name = name;
            this.money = money;
            this.height = height;
            this.weight = weight;
            this.gender = gender;
            this.experience = experience;
            AutoSelectAims();
        }

        public void SetWight(float weight)
        {
            this.weight = weight;
//            AutoSelectAims();
        }
        
        public void SetHeight(float height)
        {
            this.height = height;
//            AutoSelectAims();
        }

        private void AutoSelectAims()
        {
            float bim = weight / (height * height);
            if (bim > 27)
            {
                aims = Aims.LoseWeight;
            }
            else if (bim < 18.5)
            {
                aims = Aims.Muscle;
            }
            else
            {
                aims = Aims.Daily;
            }
        }
    }
}